//
//  ACWMetroTicketVC.m
//  aichewang
//
//  Created by rylynn lai on 16/2/25.
//  Copyright © 2016年 aichewang. All rights reserved.
//

#import "ACWMetroTicketVC.h"
#import "RLPullDownMenu.h"
#import "ACWPaymentVC.h"

//临时假数据
#define lineArr  @[@"选择线路", @"line1", @"line2"]
#define line1Station @[@"选择起点车站", @"line1A", @"line1B", @"line1C", @"line1D", @"line1E", @"line1F", @"line1G", @"line1H", @"line1I", @"line1J"]
#define line2Station  @[@"选择起点车站", @"line2A", @"line2B", @"line2C", @"line2D", @"line2E", @"line2F"]

@interface ACWMetroTicketVC ()<RLPullDownMenuDelegate>

@property (weak, nonatomic) IBOutlet RLPullDownMenu *metroLine;
@property (weak, nonatomic) IBOutlet RLPullDownMenu *startStation;
@property (weak, nonatomic) IBOutlet RLPullDownMenu *endStation;

@end
@implementation ACWMetroTicketVC


- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setUp];
}

- (void)setUp {
    _metroLine.delegate = self;
    _startStation.delegate = self;
    _endStation.delegate = self;
    
    _metroLine.itemsArray = lineArr;
    _startStation.itemsArray = line1Station;
    _endStation.itemsArray = line1Station;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)placeOrder {
    ACWPaymentVC *paymentVC = [[ACWPaymentVC alloc] init];
    [self pushNavControllerWithoutBottomBar:paymentVC];
}

- (void)pullDownMenu:(RLPullDownMenu *)pullDownMenu didSelectRow:(NSInteger)row {
    if (pullDownMenu == _metroLine) {
        switch (row) {
            case 0:
                _startStation.itemsArray = line1Station;
                _endStation.itemsArray = line1Station;
                break;
            case 1:
                _startStation.itemsArray = line2Station;
                _endStation.itemsArray = line2Station;
                break;
            default:
                break;
        }
    }
}



@end
